		.global SumaTotal
		.ent SumaTotal
SumaTotal:	# begin stack frame creation
		subu $sp, $sp, 24
		sw $fp, 20($sp)
		sw $gp, 16($sp)
		move $fp, $sp
		sw $4, 24($fp)
		sw $5, 28($fp)
		sw $6, 32($fp)
		sw $7, 36($fp)
		add $8, $0, $0
		sw $8, 0($fp)
		sub.d $f4, $f4, $f4
		s.d $f4, 8($fp)
		# end stack frame creation
		# start adding
loop:		#*cantidadElementos  
		lw $9, 0($6)
		sll $9, $9, 3
		sll $11, $8, 3
		#(i < *cantidadElementos)
		sub $10, $9, $11
		blez $10, continue
		#(topePila + i);
		add $12, $4, $11
		#*(topePila + i);
		l.d $f6, 0($12)
		#suma+=*(topePila + i);
		add.d $f4, $f4, $f6
		s.d $f4, 8($fp)
		#i++;
		addi $8, $8, 1
		sw $8, 0($fp)
		j loop		
		# finish adding	
continue:	# *resultadoSuma = suma
		s.d $f4, 0($7)
		addi $2, $0, 1
		# start destroying stack frame
		lw $fp, 20($sp)
		lw $gp, 16($sp)
		addi $sp, $sp, 24
		# completely detroyed stack frame
		# return
		j $31
		.end SumaTotal
